﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WeChat.ViewModel;

namespace WeChat.View
{
    /// <summary>
    /// ChatContentView.xaml 的交互逻辑
    /// </summary>
    public partial class ChatContentView : UserControl
    {
        public ChatContentView()
        {
            InitializeComponent();
            this.DataContext = new ChatContentViewModel();
            myPopup.CustomPopupPlacementCallback = new CustomPopupPlacementCallback(placePopup);
        }

        private CustomPopupPlacement[] placePopup(Size popupSize, Size targetSize, Point offset)
        {
            CustomPopupPlacement placementVertical = new CustomPopupPlacement(new Point(0, 0), PopupPrimaryAxis.Vertical);
            CustomPopupPlacement placementHorizontal = new CustomPopupPlacement(new Point(0, 0), PopupPrimaryAxis.Horizontal);
            CustomPopupPlacement[] ttplaces = new CustomPopupPlacement[] { placementVertical, placementHorizontal };
            return ttplaces;
        }
    }
}
